package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.common.dto.admin.AddStoreCodeBatchDto;
import com.frejoys.common.dto.common.PageDto;
import com.frejoys.common.vo.admin.StoreCodeBatchListVo;
import com.frejoys.dao.entity.Category;
import com.frejoys.dao.entity.StoreCodeBatch;

public interface StoreCodeBatchService extends IService<StoreCodeBatch> {

    default StoreCodeBatch getOnly(QueryWrapper<StoreCodeBatch> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default StoreCodeBatch getOnly(LambdaQueryWrapper<StoreCodeBatch> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    //支付码生成
    Integer addStoreCodeBatch(AddStoreCodeBatchDto dto,Long userId);

    IPage<StoreCodeBatchListVo> storeCodeBatchListInfo(PageDto dto);
}
